from flask import Flask, redirect, url_for, request

app = Flask(__name__)

@app.route('/admin')
def hello_admin():
    return 'Hello admin'

@app.route('/welcolme/<name>')
def welcolme(name):
    return f'Welcolme {name}'

@app.route('/login', methods=['POST', 'GET'])
def login():
    if request.method == 'POST':
        user = request.form['nm']
        return redirect(url_for('welcolme', name=user))
    else:
        user = request.args.get('nm')
        return redirect(url_for('welcolme', name=user))

if __name__ == '__main__':
    app.run(debug=True)